#include "DataStructure/Input/Element/CONM2Data.h"

#include "DataStructure/Common/Validation.h"

using namespace SG::DataStructure;

/// @brief 判断两个CONM2Data是否相等
/// @param a
/// @param b
/// @return
bool SG::DataStructure::FEM::operator== (CONM2Data& a, CONM2Data& b)
{
    if (a.m_id != b.m_id)
    {
        return false;
    }
    if (a.m_g[0] != b.m_g[0])
    {
        return false;
    }
    if (a.m_cId != b.m_cId)
    {
        return false;
    }
    if (a.m_mass != b.m_mass)
    {
        return false;
    }
    if (a.m_domainId != b.m_domainId)
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_I1[0], b.m_I1[0]) || !SG::DataStructure::Common::isNear (a.m_I2[0], b.m_I2[0])
        || !SG::DataStructure::Common::isNear (a.m_I2[1], b.m_I2[1]) || !SG::DataStructure::Common::isNear (a.m_I3[0], b.m_I3[0])
        || !SG::DataStructure::Common::isNear (a.m_I3[1], b.m_I3[1]) || !SG::DataStructure::Common::isNear (a.m_I3[2], b.m_I3[2]))
    {
        return false;
    }
    return true;
}